<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <link href="/Public/Admin/css/new_plan.css" rel="stylesheet" />
    <script src="/Public/static/layer/layer.js"></script>
    <!--文件上传-->
    <script type="text/javascript" src="/Public/Cropper/js/ajaxfileupload.js" ></script>
    <style>
        .news{
            width: 80%;
            margin:1rem auto;
        }
        .newsHeader{
            text-decoration: underline;
        }
        .news_title{
            border: 0px solid red;
            height:45px;
            text-align: center;
            margin-top: 22px;
            margin-bottom: 65px;
            font-size: 30px;
        }
        .news_content{
            color: #515151;
            font-size:21px;
            FONT-FAMILY: 仿宋;
            line-height: 215%;
        }
        .news_keyword{
            color: #1781d0;
            text-decoration: underline;
            margin-top: 20px;
        }
        .keyword{display: none;margin-top: 20px;}
        .attach{margin:20px auto;text-align: center;}
        .attach img{width:80%;margin:0 auto;display:inline-block}
        .attach_item{color: #1781d0;margin-top: 10px;}
        .news_edit{margin-top:20px;font-size: 15px;}
        .views{margin:20px auto;text-align: center;}
        .view{
            display: inline-block;
            width: 75px;
            height: 30px;
            line-height: 30px;
            background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e2e2e2), color-stop(100%, #b1b1b1));
            border-radius: 6px;
            font-size: 15px;
            margin-right: 10px;
        }
        .newsHeader{font-size:15px;width:100%;margin-left: 13%;inmargin-bottom: 160px;}
        .newsHeader ul li{width:33%;float:left;margin-bottom: 20px;}  
        .news_comment{font-size: 15px;margin-top: 20px;}
    </style>
</block>
<block name="content"> 
    <section class="layui-larry-box">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <div class="layui-inline">
                        <if condition="$is_manage neq 1">
                            <a class="layui-btn layui-btn-normal newsAdd_btn" href="{:U('Personal/news',array('is_read'=>$_GET['is_read'],'from_id'=>$_GET['from_id'],'type_id'=>$_GET['type_id'],'subject'=>$_GET['subject'],'send_time'=>$_GET['send_time'],'content'=>$_GET['content']))}">返回</a>
                            <else />
                            <a class="layui-btn layui-btn-normal newsAdd_btn" href="{:U('Erp/newsManage',array('type_id'=>$_GET['type_id']))}">返回</a>
                        </if>
                    </div>

                </blockquote>
                <div class="layui-tab-item layui-field-box layui-show absence">
                    <div class="news">
                        <div class="news_title">【{$data.type_id|getNewsTypeName}】{$data.subject}</div>
                        <div class="newsHeader">
                            <ul>
                                <li>新闻类型：{$data.type_id|getNewsTypeName}</li>
                                <li>发布人：{$data.provider|getChineseName}</li>
                                <li>点击量：{$data.click_count}</li>
                                <li>发布时间：{$data.news_time}</li>
                                <li>发布范围：
                                <if condition="$data.to_id neq 'ALL_DEPT'">
                                    <notempty name="data.to_id">
                                        <foreach name="data.to_id" item="dept">
                                            {$dept|getDeptName},
                                        </foreach>
                                    </notempty>
                                    <else />
                                    全体部门,
                                </if>
                                <notempty name="data.priv_id">
                                    <foreach name="data.priv_id" item="priv">
                                        {$priv|getPrivName},
                                    </foreach>
                                </notempty>
                                <notempty name="data.user_id">
                                    <foreach name="data.user_id" item="user">
                                        {$user|getChineseName},
                                    </foreach>
                                </notempty>
                                </li>
                            </ul>
                        </div>
                        <p style="clear:both;"></p>
                        <if condition="$uploads neq null">
                            <div class="attach">
                                <foreach name="uploads" item="upload">
                                    <img src="{$upload.upload}" />
                                </foreach>
                            </div>
                        </if>
                        <div class="news_content">{$data.content|htmlspecialchars_decode}</div>
                        <if condition="$data.keyword neq ''">
                            <div class="news_keyword">显示本文关键词</div>
                            <div class="keyword">本文关键词：<font style="color: #1781d0;">{$data.keyword}</font></div>
                        </if>
                        <if condition="$data.last_editor neq ''">
                            <div class="news_edit"><font style="text-decoration: underline;margin-right: 10px;">{$data.last_editor|getChineseName}</font>最后编辑于：{$data.last_edit_time}</div>
                        </if>
                        <notempty name="news_comment">
                            <div class="news_comment">
                                <font style="font-weight: bolder;">最新5条评论</font>
                                <foreach name="news_comment" item="comment">
                                    <div style="margin: 10px auto;">
                                        <p style="background: #f2f2f2;"><font style="margin-right: 10px;">{$comment.user_id|getChineseName}</font>发表时间：{$comment.re_time}</p>
                                        <p>&nbsp;&nbsp;{$comment.content}</p>
                                        <if condition="$comment['parent_id'] neq 0">
                                            <p style="margin:5px auto;">
                                            <p style="font-weight:bolder;">【原贴】</p>
                                            <foreach name='comment["initial_comment"]' item='initial'>
                                                {$initial.content}
                                            </foreach>
                                            </p>
                                        </if>
                                        <p style="float: right;">
                                            <a class="pointer replyComment" data-id="{$comment.comment_id}" style="color: #1781d0;text-decoration: underline;margin-right: 10px;">回复本贴</a>
                                        <if condition="$comment.is_del eq 1">
                                            <a class="pointer delComment" data-url="{:U('delComment',array('comment_id'=>$comment['comment_id']))}" style="color: #1781d0;text-decoration: underline;margin-right: 10px;">删除</a>
                                        </if>
                                        回复数：{$comment.reply_count}
                                        </p>
                                        <p style="clear: both;"></p>
                                    </div>
                                </foreach>
                            </div>
                        </notempty>
                        <!--0代表实名评论  1代表匿名评论  2代表禁止评论-->
                        <if condition="$data['anonymity_yn'] neq 2">
                            <form name='form1'>
                                <input type="hidden" name="is_manage" value="{$is_manage}">  
                                <input type="hidden" name="news_id" id="news_id" value="{$data.news_id}">
                                <div style="margin:20px auto;font-size:15px;">
                                    <p style="font-weight:bolder;">发表评论</p>
                                    <div>
                                        <p>内容：<textarea name='content' id="CONTENT" rows="5" cols="100"></textarea></p>
                                        <p style="margin-top: 20px;">署名： 
                                        <lable class="input_lable">
                                            <i class='input_style radio_bg radio_bg_check'><input type="radio" name="USER_ID"  value="{$user_id}" ></i>
                                            {$user_id|getChineseName}
                                        </lable>
                                        </p>
                                    </div>
                                    <a class="layui-btn btn-submit ajax-post" data-url="{:U('commentNews')}" style="display: inline-block;margin-left: 45px;margin-top:20px;">发表</a>
                                </div>
                            </form>
                        </if>
                    </div>
                </div>
            </div>
        </div>

    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/personal.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <script type="text/javascript">
        $(initPersonal())
    </script>    

</block>
